// Decompiled by Jad v1.5.7f. Copyright 2000 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/SiliconValley/Bridge/8617/jad.html
// Decompiler options: packimports(3) 
// Source File Name:   InitTxAction.java

package com.iphaeton.lms.action.init;

import com.iphaeton.exception.BusinessException;
import com.iphaeton.lms.business.init.IInitService;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts.action.*;

// Referenced classes of package com.iphaeton.lms.action.init:
//            InitBizSupportAction

public class InitTxAction extends InitBizSupportAction
{

    public InitTxAction()
    {
    }

    public ActionForward initSystem(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
        throws IOException, ServletException
    {
        String realPath = request.getRealPath("\\");
        try
        {
            init.initSystem(realPath + "WEB-INF\\database\\");
        }
        catch(BusinessException e)
        {
            e.printStackTrace();
            request.setAttribute("exception", e);
            return mapping.findForward("failure");
        }
        return mapping.findForward("success");
    }

    public ActionForward initQuestion(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
        throws IOException, ServletException
    {
        String realPath = request.getRealPath("\\");
        try
        {
            init.initQuestion(realPath + "WEB-INF\\database\\question.xml");
        }
        catch(BusinessException e)
        {
            e.printStackTrace();
            request.setAttribute("exception", e);
            return mapping.findForward("failure");
        }
        return mapping.findForward("success");
    }
}
